 <#include "../common/head.ftl">
 <style>
 #menuu {
            top: 0px;
        }

        #menuu ul li a {
            display: block;
            margin: 5px 0;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            width: 80px;
            height: 50px;
            line-height: 50px;
            text-decoration: none;
            text-align: center;
        }
.current1{
color: #0089E9;
font-weight:700;
}
        #menuu ul li a:hover,
        #menuu ul li a.current1 {
            color: #fff;
            background: #0088bb;
        }

        * html, * html body {
            background-image: url(about:blank);
            background-attachment: fixed;
        }

        * html #menuu {
            position: absolute;
            bottom: auto;
            top: expression(100+((e=document.documentElement.scrollTop)?e:document.body.scrollTop)+'px');
        }
 </style>
   <script type="text/javascript">
        $(function () {

            var nav = $("#menuu"); //得到导航对象

            var win = $(window); //得到窗口对象

            var sc = $(document);//得到document文档对象。

            win.scroll(function () {

                if (sc.scrollTop() >= 300) {

                    nav.addClass("fixednav");


                } else {

                    nav.removeClass("fixednav");
                }
            });
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(window).scroll(function () {
                var items = $("#itemss").find(".am-panel");
                var menuu = $("#menuu");
                var top = $(document).scrollTop();
                var currentId = ""; //滚动条现在所在位置的item id
                items.each(function () {
                    var m = $(this);
                    //注意：m.offset().top代表每一个item的顶部位置
                    if (top > m.offset().top - 100) {
                        currentId = "#" + m.attr("id");
                    } else {
                        return false;
                    }
                });

                var currentLink = menuu.find(".current1");
                if (currentId && currentLink.attr("href") != currentId) {
                    currentLink.removeClass("current1");
                    menuu.find("[href=" + currentId + "]").addClass("current1");
                }
            });
        });
    </script>
    <style>
    	.fixednav{
        	background-color:#FAFAFA !important;
        	position:fixed;
        	top:0px;
        	width:285px;
        	}
        	#menuu{
        	text-align:center;
        	
        	}
    </style>
     <link href="${base}/resources/css/person.css" rel="stylesheet">
 
 <script src="${base}/resources/js/jquery-1.4.4.js" type="text/javascript"></script>
<script src="${base}/resources/js/formValidator-4.0.1.js" type="text/javascript" charset="UTF-8"></script>
<script src="${base}/resources/js/formValidator-4.0.1.min.js" type="text/javascript" charset="UTF-8"></script>
<script src="${base}/resources/js/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<script src="${base}/resources/js/zepto.js"></script>
<!--[if lte IE 9]>
<script src="${base}/resources/js/jquery.placeholder.min.js"></script>
<script>$(function() {$('input, textarea').placeholder();});</script>
<![endif]--> 
<div class="content">
    <div class="con_left">
        <div class="con_head">
            <ul class="jlop">
                <li style="border-right:none">
                    <p id="download_total">
                    <#if enterpriseInit ??>${enterpriseInit[0].download_total}<#else>0</#if>
                    </p>
                    <span>剩余下载次数</span>
                </li>
                <li style="border-right:none">
                    <p id="resume_get_total">
                    <#if enterpriseInit ??>${enterpriseInit[0].resume_get_total}<#else>0</#if>
                    </p>
                    <span>当日收到简历份数</span>
                </li>
                <li>
                    <p id="resume_favor_total">
                    <#if enterpriseInit ??>${enterpriseInit[0].resume_favor_total}<#else>0</#if>
                    </p>
                    <span>当日收藏简历份数</span>
                </li>
            </ul>
        </div>
        <div class="tttt" style="clear: both;padding-top: 30px;">
            <img src="${base}/resources/images/tttt.png">
            <span >修改密码</span>
        </div>
        <form action="" method="post" name="form" id="form1" style="clear: both;padding-top: 50px;">
        <ul class="cominfo">
            <li class="phone" style=" padding: 35px;margin-top: 50px;">
                <span>您登录的手机号是:</span> <span>${userName}</span>
            </li>
            <li style="border-bottom: 1px dashed #d5d5d5;">
                <b>当前密码</b><span>（6-16位数字和字母组合）</span>
                <input type="password" placeholder="输入当前密码" style="" id="password_old" maxlength='16'>
                <div  id="dqpasswordTip" class="onShow"></div>
            </li>
            <li style="border-bottom: 1px dashed #d5d5d5;">
                <b>新密码</b><span>（6-16位数字和字母组合）</span>
                <input type="password"  placeholder="请输入新密码" style="" id="password_new" maxlength='16'>
                <div  id="password1Tip" class="onShow"></div>
            </li>
            <li style="border-bottom: 1px dashed #d5d5d5;">
               <b>确认密码</b><span>（6-16位数字和字母组合）</span>
                <input type="password"  placeholder="再次输入新密码" style=""  id="password_new2" maxlength='16'>
                <div  id="password2Tip" class="onShow"></div>
            </li>
            <li style="margin-top: 20px">
                <a href="javascript:;" onclick="chPaw();">确定修改密码</a>
            </li>
        </ul>
            </form>
    </div>
    <div class="con_right">
        <ul>
            <li style="padding-bottom: 40px">
                <div style="text-align: center;" class="lou">
                	<a class="sclogo">
	                	<#if enterpriseInit ??>
		                	<#if enterpriseInit[0].logo_url=="">
		                		<img src="${base}/resources/images/lou.png">
		                	<#else>
		                		<img src="${enterpriseInit[0].logo_url}">
		                	</#if>
	                	<#else>
	                	<img src="${base}/resources/images/lou.png">
	                	</#if>
                	</a>
                    <div class="vv" id="sfsh">
                    <#if enterpriseInit ??>
	                    <#if enterpriseInit[0].ent_status=="0">
	                    	<img src='${base}/resources/images/v.png'>
	                    </#if>
                    </#if>
                    </div>
                    <ul class="comadd">
                        <li><b>公司名称：</b><b id="company_name">
                         <#if enterpriseInit ??>
                         	<#if enterpriseInit[0].company_name!=''&&enterpriseInit[0].company_name!='\"null\"'>
	                         	${enterpriseInit[0].company_name}
	                         <#else>未填写</#if>
                         <#else>未填写</#if>
                        </b></li>
                        <li><b>公司地址：</b><b id="cityzzz">
                         <#if enterpriseInit ??>
	                         <#if enterpriseInit[0].city_id_1!='0'&&enterpriseInit[0].city_id_1!=''>
	                         	${enterpriseInit[0].city_id_1}
		                          <#if enterpriseInit[0].city_id_2!='0'&&enterpriseInit[0].city_id_2!=''>
		                          /${enterpriseInit[0].city_id_2}
			                          <#if enterpriseInit[0].city_id_3!='0'&&enterpriseInit[0].city_id_3!=''>
			                          /${enterpriseInit[0].city_id_3}
									 </#if>
								 </#if>
							<#else>未填写</#if>
                         <#else>未填写</#if>
                        </b></li>
                    </ul>
                </div>
            </li>
            <li style="text-align: center;padding: 10px;color:#0089e9;font-weight: 600;">完善企业信息</li>
            <li>
                    <ul id="menuu" style="margin: 0px auto;"><!-- 
                    <li><a href="#qymc1">企业名称</a></li>
                    <li><a href="#sshy1" class="">所属行业</a></li>
                    <li><a href="#qyxz1" class="">企业性质</a></li>
                    <li><a href="#gzdq1" class="">工作地区</a></li>
                    <li><a href="#jtdd1" class="">具体地点</a></li>
                    <li><a href="#yyzz1">营业执照</a></li>
                    <li><a href="#gsjj1">公司简介</a></li>
                    <li><a href="#rsgm1">人数规模</a></li>
                    <li><a href="#qylogo1">企业logo</a></li>
                    <li><a href="#gswz1">公司网址</a></li>
                    <li><a href="#lxdh1">联系电话/座机</a></li> -->
                    <li><a href="${base}/enterprise/viewCenter">企业中心</a></li>
                    <li><a class="am-active"  style="color: #0089e9" href="${base}/enterprise/chPaw">修改密码</a></li>
                		<li style="margin-top: 55px;text-align: center;font-weight: 600;float: left;margin-left: -26px;">
                    <li><span style="font-size: 15px;">客服：4008-907-977</span></li>
                    </li>
                </div>
                </ul>
            </li>
           
        </ul>
    </div>
</div>
 <#include "../common/bottom.ftl">
<script type="text/javascript">
	$base = "${base}";
    $(document).ready(function(){
        $.formValidator.initConfig({formID:"form1",debug:false,submitOnce:true,
            onError:function(msg,obj,errorlist){
                $("#errorlist").empty();
                $.map(errorlist,function(msg){
                    $("#errorlist").append("<li>" + msg + "</li>")
                });
                layer.alert(msg, {icon: 2,skin: 'layer-ext-moon'});
            },
            submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
        });

        $("#us").formValidator({onShow:"请输入用户名,只有输入\"maodong\"才是对的",onFocus:"用户名至少5个字符,最多10个字符",onCorrect:"OK"}).inputValidator({min:5,max:10,onError:"你输入的用户名非法,请确认"})//.regexValidator({regExp:"username",dataType:"enum",onError:"用户名格式不正确"})
                .ajaxValidator({
                    dataType : "html",
                    async : true,
                    url : "http://www.51gh.net/chkuser.aspx?act=ok",
                    success : function(data){
                        if( data.indexOf("此用户名可以注册!") > 0 ) return true;
                        if( data.indexOf("此用户名已存在,请填写其它用户名!") > 0 ) return false;
                        return false;
                    },
                    buttons: $("#button"),
                    error: function(jqXHR, textStatus, errorThrown){layer.alert("服务器没有返回数据，可能服务器忙，请重试"+errorThrown, {icon: 2,skin: 'layer-ext-moon'});},
                    onError : "该用户名不可用，请更换用户名",
                    onWait : "正在对用户名进行合法性校验，请稍候..."
                }).defaultPassed();
        $("#dqpassword").formValidator({onShow:"请填写当前密码",onFocus:"必须填写",onCorrect:"OK",defaultValue:""}).inputValidator({min:1,onError: "必须填写"});
        $("#password1").formValidator({onShow:"请输入密码",onFocus:"至少1个长度",onCorrect:"OK"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"密码两边不能有空符号"},onError:"密码不能为空,请确认"});
        $("#password2").formValidator({onShow:"输再次输入密码",onFocus:"至少1个长度",onCorrect:"OK"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"重复密码两边不能有空符号"},onError:"重复密码不能为空,请确认"}).compareValidator({desID:"password1",operateor:"=",onError:"2次密码不一致,请确认"});
        $("#email").formValidator({onShow:"请输入邮箱",onFocus:"邮箱6-100个字符",onCorrect:"OK",defaultValue:""}).inputValidator({min:6,max:100,onError:"你输入的邮箱长度非法,请确认"}).regexValidator({regExp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onError:"你输入的邮箱格式不正确"});
    });
	function chPaw(){
		var password_old = $("#password_old").val();
		var password_new = $("#password_new").val();
		var password_new2 = $("#password_new2").val();
		if(password_old==null || password_old==""){
			layer.alert("请输入原密码!", {icon: 0,skin: 'layer-ext-moon'});
			return false;
		}
		if(password_new==null || password_new==""){
			layer.alert("请输入新密码!", {icon: 0,skin: 'layer-ext-moon'});
			return false;
		}
		if(password_old==password_new){
			layer.alert("新密码和原密码相同，请重新输入!", {icon: 0,skin: 'layer-ext-moon'});
			return false;
		}
		if(password_new2==null || password_new2==""){
			layer.alert("请输入确认密码!", {icon: 0,skin: 'layer-ext-moon'});
			return false;
		}
		var chePassword =/^(?=.{6,16})(?=.*[a-z])(?=.*[0-9])[0-9a-z]*$/;
		if(!chePassword.test(password_new)){
			layer.alert("请输入6—16位数字和字母组合的新密码!", {icon: 0,skin: 'layer-ext-moon'});
			return false;
		}
		$.post($base + '/enterprise/chagePassword',{
 			'password_old':password_old,
 			'password_new':password_new,
 			'password_new2':password_new2
 		},function(data){
 			if(data.result==1){
 				//layer.alert(data.message, {icon: 1,skin: 'layer-ext-moon'});
 				//location.href= $base + '/enterprise/login';
 				layer.alert(data.message, {
					icon: 1,
				    skin: 'layui-layer-moon' 
				    ,closeBtn: 0
				}, function(){
					location.href= $base + '/enterprise/login';
				});
 			}else{
 				layer.alert(data.message, {icon: 2,skin: 'layer-ext-moon'});
 			}
 			
 		});
	}

</script>
</body>

</html>